package com.sqlcheck.dto.response;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 大模型配置响应
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "大模型配置响应")
public class LLMConfigResponse {

    @Schema(description = "是否启用LLM功能")
    private Boolean enabled;

    @Schema(description = "默认提供商")
    private String defaultProvider;

    @Schema(description = "最大重试次数")
    private Integer maxRetries;

    @Schema(description = "默认超时时间(秒)")
    private Integer defaultTimeout;

    @Schema(description = "可用提供商列表")
    private List<ProviderInfo> providers;

    @Schema(description = "每日使用限制")
    private Integer dailyLimit;

    @Schema(description = "每分钟使用限制")
    private Integer minuteLimit;

    @Schema(description = "今日已使用次数")
    private Integer todayUsage;

    /**
     * 提供商信息
     */
    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @Schema(description = "提供商信息")
    public static class ProviderInfo {

        @Schema(description = "提供商名称")
        private String name;

        @Schema(description = "默认模型")
        private String defaultModel;

        @Schema(description = "可用模型列表")
        private List<ModelInfo> models;

        @Schema(description = "是否可用")
        private Boolean available;

        @Schema(description = "提供商描述")
        private String description;
    }

    /**
     * 模型信息
     */
    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @Schema(description = "模型信息")
    public static class ModelInfo {

        @Schema(description = "模型名称")
        private String name;

        @Schema(description = "显示名称")
        private String displayName;

        @Schema(description = "模型描述")
        private String description;

        @Schema(description = "最大Token数")
        private Integer maxTokens;

        @Schema(description = "每千Token成本")
        private Double costPer1kTokens;

        @Schema(description = "是否可用")
        private Boolean available;
    }
}